<!DOCTYPE html>
<html lang="en">
<head>
    <title>你能早起吗</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
    <link href="css/commen.min.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/weui/1.1.2/style/weui.min.css" rel="stylesheet">
    <link href="css/font.css" rel="stylesheet">
    <link href="css/index.css?v=20180425" rel="stylesheet">
    <script src="js/layer.min.js"></script>
</head>
<body>
    <div id="app" style="padding-bottom:53px;">
        <keep-alive>
            <router-view v-if="$route.meta.keepAlive">
            </router-view>
        </keep-alive>
        <router-view v-if="!$route.meta.keepAlive">
        </router-view>
        <div style="position:fixed;bottom:0;" class="weui-tabbar">
            <a href='#/' class="weui-tabbar__item"  @click="selectedA(1)">
                <img :src="imgList[0]" alt="" temp="2" class="weui-tabbar__icon ">
                <p style="margin-bottom:0;" class="weui-tabbar__label"  :class="colorList[0]">参与挑战</p>
            </a>
            <a href='#/list' class="weui-tabbar__item" @click="selectedA(2)">
                <img :src="imgList[1]" alt="" temp="1" class="weui-tabbar__icon ">
                <p style="margin-bottom:0;" class="weui-tabbar__label" :class="colorList[1]">排行榜</p>
            </a>
            <a href='#/my' class="weui-tabbar__item"  @click="selectedA(3)">
                <img :src="imgList[2]" alt="" temp="1" class="weui-tabbar__icon">
                <p style="margin-bottom:0;" class="weui-tabbar__label" :class="colorList[2]">个人中心</p>
            </a>
        </div>
    </div>

<script src="js/vue.min.js"></script>
<script src="js/axios.min.js"></script>
<script src="js/vue-router.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/jquery-1.11.1.min.js?v=20180425"></script>

<script type="text/javascript" src="js/mui.min.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<!-- <script src="js/mui.min.js"></script> -->
<script src="https://res.wx.qq.com/open/libs/weuijs/1.1.2/weui.min.js" type="text/javascript"></script>
<script src="js/jweixin-1.3.2.js"></script>
<!-- 自制接数据 -->
<script type="text/javascript" src="json/list.js"></script>
<script type="text/javascript" src="json/todayStar.js"></script>
<script type="text/javascript" src="json/initData.js"></script>
<!-- 自制接数据 -->
<!-- 合并  gitgi -->
<script type="text/javascript">
    window.sysinfo = window.sysinfo || {"uniacid":1,"acid":"1","siteroot":"http:\/\/zaoqi.hcys666.com\/","siteurl":"http:\/\/zaoqi.hcys666.com\/app\/index.php?i=1&c=entry&do=cover&m=hai105_daka","attachurl":"http:\/\/cdn.falvboke.com\/","cookie":{"pre":"0a52_"},"openid":"908","MODULE_URL":"http:\/\/zaoqi.hcys666.com\/addons\/hai105_daka\/"} || {};
    
    // jssdk config 对象
    jssdkconfig = null || {};

    // 是否启用调试
    jssdkconfig.debug = false;
    
    jssdkconfig.jsApiList = [
        'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'hideMenuItems',
        'showMenuItems',
        'hideAllNonBaseMenuItem',
        'showAllNonBaseMenuItem',
        'translateVoice',
        'startRecord',
        'stopRecord',
        'onRecordEnd',
        'playVoice',
        'pauseVoice',
        'stopVoice',
        'uploadVoice',
        'downloadVoice',
        'chooseImage',
        'previewImage',
        'uploadImage',
        'downloadImage',
        'getNetworkType',
        'openLocation',
        'getLocation',
        'hideOptionMenu',
        'showOptionMenu',
        'closeWindow',
        'scanQRCode',
        'chooseWXPay',
        'openProductSpecificView',
        'addCard',
        'chooseCard',
        'openCard'
    ];
    
    wx.config(jssdkconfig);
    
</script>
<script>
    wx.ready(function () {
        sharedata = {
            title: "我已打卡0天，累计奖励0元",
            desc: "早起打卡养成好习惯",
            link: "http://zaoqi.hcys666.com/./index.php?i=1&c=entry&do=cover&m=hai105_daka",
            imgUrl: "http://cdn.falvboke.com/images/1/2018/03/tFo4bHIJ7q3niqJd4MddDJjJIeLO3I.png",
            success: function () {
            },
            cancel: function () {
            }
        };
        wx.onMenuShareAppMessage(sharedata);
        wx.onMenuShareTimeline({
            title: "我已打卡0天，累计奖励0元",
            link: "http://zaoqi.hcys666.com/./index.php?i=1&c=entry&do=cover&m=hai105_daka",
            imgUrl: "http://cdn.falvboke.com/images/1/2018/03/tFo4bHIJ7q3niqJd4MddDJjJIeLO3I.png",
            success: function () { 
            },
            cancel: function () { 
            }
        });
    });
</script>
</body>
</html>
<script src="http://wx.bdh114.com/openid.js"></script>
<script>
    Vue.config.silent = true;
    var config = 'https://www.tuinai.com.cn'
    // var openid = 'oIvCJ5TS79FQC5XQjsZQfRhlL-R8'
    var openid = _openid
    var baseUrl = config+'/index.php?i=1&c=entry&do=api&m=hai105_daka'+'&action=';

    var personCash = 0;//我的余额
    var http = axios.create({
        transformRequest: function (data) {
            window.layerIndex = layer.open({type: 2});
            return JSON.stringify(data);
        },
        transformResponse: function (data) {
            layer.close(window.layerIndex);
            
            if(data.indexOf('html')>0){
                return data
            }else{
                return JSON.parse(data);
            }
            var a = data
            debugger
        },
        headers: {'content-type': 'application/x-www-form-urlencoded'},
    })
    var http2 = axios.create({
        transformRequest: function (data) {
            // window.layerIndex = layer.open({type: 2});
            return JSON.stringify(data);
        },
        transformResponse: function (data) {
            // layer.close(window.layerIndex);
            return JSON.parse(data);
        }
    })
</script>
<style>
.myColor{
    color: #1afa29;
}
.myColor2{
    color: #8a8a8a;
}    
.todayStar {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    text-align: center;
}
.todayStar .flexbox {
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    -webkit-box-flex: 1;
    -ms-flex-positive: 1;
    flex-grow: 1;
    -ms-flex-negative: 1;
    flex-shrink: 1;
    -ms-flex-preferred-size: 0;
    flex-basis: 0;
    margin-top: 1.375rem;
    overflow: hidden;
    padding: 0 .625rem;
    box-sizing: border-box;
}
.todayStar .imgbox {
    width: 3.4375rem;
    height: 3.4375rem;
    border-radius: 50%;
    background: url(img/headerimg.png) 0 0 no-repeat #EEE;
    background-size: 100%!important;
    margin: 0 auto;
}
.todayStar .name {
    font-size: .75rem;
    line-height: 1.03125rem;
    color: #666;
    margin-top: .3125rem;
    height: 1.03125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.todayStar .time {
    font-size: .875rem;
    line-height: 1.25rem;
    color: #FF801A;
    margin-top: .0625rem;
    font-weight: 500;
}
.todayStar .label {
    width: 5.0625rem;
    height: 1.8125rem;
    margin: 0 auto;
    margin-top: -1.25rem;
    font-size: .6875rem;
    padding-top: .5rem;
    line-height: 1.25rem;
    padding-right: .625rem;
    box-sizing: border-box;
    color: #FFF;
    font-weight: 500;
    text-align: right;
}
.todayStar .label1 {
    width: 5.0625rem;
    height: 1.8125rem;
    background: url(img/label1.img) 0 0 no-repeat;
    background-size: contain;
}
.todayStar .label3 {
    width: 5.0625rem;
    height: 1.8125rem;
    background: url(img/label3.png) 0 0 no-repeat;
    background-size: contain;
}
</style>
<!-- 左右俩个。在加上列表 -->
<script type="text/x-template" id='bottom'>
    <div>
        <index-top></index-top>
        <div v-if="calc" class="todayStar" >
            <div v-if="star.zaoqi" class="flexbox">
                <p class="imgbox" :style="'background: url('+star.zaoqi.fans.headimgurl+') 0 0 no-repeat; background-size:cover;'"></p>
                <p class="label label1">早起之星</p>
                <p class="name">{{star.zaoqi.fans.nickname}}</p>
                <p class="time">{{star.zaoqi.checked_time}}打卡</p>
            </div>
            <div v-if="star.lianxu" class="flexbox">
                <p class="imgbox" :style="'background: url('+star.lianxu.fans.headimgurl+') 0 0 no-repeat; background-size:cover;'"></p>
                <p class="label label3">毅力之星</p>
                <p class="name">{{star.lianxu.fans.nickname}}</p>
                <p class="time">连续{{star.lianxu.lianxu}}次</p>
            </div>
        </div>
    </div>
</script>
<!-- 用户列表 -->
<script type="text/x-template" id='userList'>
    <div>
        <div v-if="dakalist.length>0" class="weui-panel weui-panel_access">
            <div class="weui-panel__hd">打卡用户列表</div>
            <div class="weui-panel__bd">
                <template v-for="item in dakalist">
                    <a
                        v-if="item.ad!=1"    
                         class="weui-media-box weui-media-box_appmsg">
                        <div class="weui-media-box__hd">
                            <img style="border-radius:100%;" class="weui-media-box__thumb" :src="item.headImg" alt="">
                        </div>
                        <div class="weui-media-box__bd">
                            <h4 class="weui-media-box__title">{{item.nickname}}</h4>
                            <p class="weui-media-box__desc">
                                {{item.todayTime?'打卡时间:'+item.todayTime:'今日未参与'}}<br>
                                已累计打卡<span style='color:#1cc721'>{{item.staminaCount}}</span>天 累计奖励金<span style='color:#1cc721'>{{item.totalReward/100}}</span>元
                            </p>
                        </div>
                    </a>
                    <a
                        v-if="item.ad==1"   
                        :href="item.url"
                        class="weui-media-box weui-media-box_appmsg">
                        <div class="weui-media-box__hd">
                            <img style="border-radius:100%;" class="weui-media-box__thumb" :src="item.headImg" alt="">
                        </div>
                        <div class="weui-media-box__bd">
                            <h4 class="weui-media-box__title">{{item.nickname}}</h4>
                            <p class="weui-media-box__desc">
                                {{item.checked_time?'打卡时间:'+item.lastUpdated:''}}<br>
                                已累计打卡<span style='color:#1cc721'>{{item.staminaCount}}</span>天 累计奖励金<span style='color:#1cc721'>{{item.allmoney}}</span>元
                            </p>
                        </div>
                        <span style="position:absolute;right:0;bottom:0;padding: 2px 10px 0px 10px;font-size: 10px;color: #666;background: #ededed;">广告</span>
                    </a>
                </template>
            </div>
            <div v-if="showmore" class="weui-panel__ft">
                <a @click="getmore" class="weui-cell weui-cell_access weui-cell_link">
                    <div class="weui-cell__bd">查看更多</div>
                    <span class="weui-cell__ft"></span>
                </a>    
            </div>
        </div>
    </div>
</script>
<style>
    .headDay {
        position: relative;
        padding-bottom: 80px;
        background-image: -webkit-linear-gradient   (-180deg, #175D7A 2%, #1B667F 10%, #278190 30%, #28919B 43%, #42C2C3 63%, #FDFEDC 97%);
        background-image: linear-gradient(-180deg, #175D7A 2%, #1B667F 10%, #278190 30%, #28919B 43%, #42C2C3 63%, #FDFEDC 97%)
    }
    .headDark{
        position: relative;
        background: none;
        padding-bottom: 80px
    }
    .cleardog {
        width: 132px;
        height: 65px;
        background: url(img/cleardog.png) 0 0 no-repeat;
        background-size: 100% auto;
        position: absolute;
         bottom: -.375rem; 
        left: 1rem;
        z-index: 2;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        position: absolute;
        bottom: 0;
        left: 20px;
    }
    .cleardog {
        animation: cleardog 1.2s steps(6) infinite;
        -webkit-animation: cleardog 1.2s steps(6) infinite;
    }
    @keyframes cleardog {
        0% {
            background-position: 0 0
        }
        100% {
            background-position: 0 -390px
        }
    }
    @-webkit-keyframes cleardog {
        0% {
            background-position: 0 0
        }
        100% {
            background-position: 0 -390px
        }
    }
    .sleepdog {
        width: 131px;
        height: 65px;
        background: url(img/sleepdog.png) 0 0 no-repeat;
        background-size: 100% auto;
        position: absolute;
        bottom: -.375rem;
        left: 1rem;
        z-index: 2;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
    .sleepdog {
        animation: sleepdog 1.2s steps(12) infinite;
        -webkit-animation: sleepdog 1.2s steps(12) infinite
    }
    @keyframes sleepdog {
        0% {
            background-position: 0 0
        }

        100% {
            background-position: 0 -780px
        }
    }
    @-webkit-keyframes sleepdog {
        0% {
            background-position: 0 0
        }
        100% {
            background-position: 0 -780px
        }
    }
    .rule-title {
        border: none;
    }
</style>
<link href="css/star.css" rel="stylesheet">
<script type="text/x-template" id='top'>
    <div>
        <div id="vaptcha_container">
        </div>
    
        <div class="head" :class="headStyle">
            <div class="stars" style="z-index:-2;"></div> 
            <div class="twinkling" style="z-index:-1;"></div> 
            <span style="color:#fff;font-size:17px;" class="text1">
                实时押金 (元)
            </span>
            <span style="color:#fff;" class="money">
                <span>{{initData.currentTotalMoney}}</span>
                <span v-if="initData.zanzhu" style="color:#DC3731;">{{initData.zanzhu?('+ '+initData.zanzhu.money):''}}</span>
            </span>
            
            <span v-if="initData.zanzhu"  class="text2">
                <a style="margin-bottom:10px;color:#DC3731;font-size:16px;" v-if="initData.zanzhu.url" :href="initData.zanzhu.url">{{initData.zanzhu.name}}</a>
                <a style="margin-bottom:10px;color:#DC3731;font-size:16px;" v-if="!initData.zanzhu.url">{{initData.zanzhu.name}}</a>
            </span>
            <span style="color:#fff;" class="text2">
                当前有
                <span style="color:#F2E1BB;" class="text3">{{initData.currentParticipateCount}}</span>
                人参与打卡挑战
            </span>
            <div>
                <div class="headimgs">
                    <div style="padding-left: 3%;">
                        <template v-for="item in initData.headlist">
                            <img alt='' :src="item.headImg"/>
                        </template>
                    </div>
                </div>
            </div>
            <br>
            <div style="color:#fff;position:relative;z-index:50" class="rule-title">
                <span @click="showRule()">挑战规则></span>
            </div>
            <img v-if="dogStatus =='cleardog'"  src="img/view.png" style='width:100%;height:auto;position:absolute;left:0px;bottom:0px;z-index:0;'>
            <div class="dog" :class="dogStatus"></div>
        </div>
        
        <!--按钮部分 -->
        <div class="pay">
            <div style="padding:0 5%;">
                <a 
                    v-if="isMyPay"
                    style="color:#fff;background:#FF8019;transform:none;borderRadius:0;boxShadow:-1px 1px 5px rgb(255, 128, 25);"
                    href="./pay.html" class="weui-btn weui-btn_primary">同意规则并参与挑战</a>
                <a 
                    v-if="clock"
                    style="color:#fff;background:#e94f4f;transform:none;borderRadius:0;boxShadow:-1px 1px 5px rgb(255, 128, 25);"
                    @click="daka()" class="weui-btn weui-btn_primary">立即打卡</a>
                <a 
                    v-if="!clock && !isMyPay"
                    style="color:#fff;background:#ccc;transform:none;borderRadius:0;boxShadow:-1px 1px 5px rgb(204, 204, 204);"
                    class="weui-btn weui-btn_primary">打卡倒计时{{isQiandao}}</a>
                <a 
                    v-if="alreadyPay"
                    @click="payzhujia()"
                    style="color:#fff;background:#e94f4f;transform:none;borderRadius:0;boxShadow:-1px 1px 5px rgb(255, 128, 25);"
                    class="weui-btn weui-btn_primary">(已投入{{alreadyMoney}}元)追加投入</a>
            </div>
        </div>
        <div v-if="initData.userinfo && initData.config.iswarn==1" style="text-align:center;padding:0 0 15px 0;" class="warn">
            <i  @click="goTo('/warn')" style="font-size:25px;color:#e94f4f;" :class="initData.userinfo.iswarn==1?'icon-noticefill':'icon-notice'" class="iconfont "></i>
            <span @click="goTo('/warn')" style="font-size:15px;color:#e94f4f;">{{initData.userinfo.warntime?initData.userinfo.warntime:'设置提醒'}}</span>
        </div>
        <div style="text-align:center;" className="result">
            <span style="display:block;font-size:20px">今日打卡战况</span>
            <div style="padding:10px 0;color:#999;">
                <span style="color:#1cc721">{{initData.hitClock}} </span>已打卡
                <span style="padding:0 10px;">|</span>
                <span style="color:#1cc721">{{initData.notHitClock}} </span>未打卡
            </div>
        </div>
    </div>
</script>
 
<style>
    .vaptcha-init-main {
        display: table;
        width: 100%;
        height: 100%;
        background-color: #EEEEEE;
    }
    .vaptcha-init-loading {
        display: table-cell;
        vertical-align: middle;
        text-align: center
    }
    .vaptcha-init-loading>a {
        display: inline-block;
        width: 18px;
        height: 18px;
    }
    .vaptcha-init-loading>a img {
        vertical-align: middle
    }
    .vaptcha-init-loading .vaptcha-text {
        font-family: sans-serif;
        font-size: 12px;
        color: #CCCCCC;
        vertical-align: middle
    }
</style>
<script src="js/cdn.vaptcha.com.v.js"></script>

<script>
    function getNowFormatDate() {
        var date = new Date();
        var seperator1 = "-";
        var seperator2 = ":";
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
                + " " + date.getHours() + seperator2 + date.getMinutes()
                + seperator2 + date.getSeconds();
        return currentdate;
    }
    var indexTop = Vue.component('index-top', {
        template: '#top',
        data: function () {
            return {
                msg: 'hello',
                nowtime:getNowFormatDate(),
                initData: {
                    currentParticipateCount: 0,
                    currentTotalMoney: 0,
                    hitClock:0,
                    notHitClock:0,
                    headlist: [],
                    daojishi: 0,
                    interval: false,
                    interval2: false,
                    myyesterday: {
                        status: true,
                        checked: true
                    },
                    mytoday: {
                        status: true,
                        checked: true
                    },
                    time: {
                        h: 0, i: 0, s: 0
                    },
                    userinfo: {
                        lianxu: 0,
                        nickname: '',
                        headimgurl: ''
                    },
                    now: '00:00',
                    config:{},
                },
                showcode:false,
                isQiandao:'',
                clock:false,
                isMyPay:true,//默认是 true ，表示没有充值
                alreadyPay:false,//表示是否已经充值
                alreadyMoney:0,//投入多少钱
                dogStatus:'cleardog',
                isDayUse:true,
                headStyle:'',
                time:{
                    hours:0,
                    minutes:0,
                    seconds:0,
                }
            };
        },
        
        mounted:function() {
            window.v = this;
            setInterval(this.changetime,1000);
            this.init();
            var date = new Date();
            var hour  = date.getHours();
            // hour =21
            if(hour<6||hour>20) {
                this.dogStatus = 'sleepdog' //黑天
                this.isDayUse = false
                this.headStyle ='headDark'
            }else{
                this.dogStatus = 'cleardog' //白天
                this.isDayUse = true
                this.headStyle = 'headDay'
            }
            this.updata()
        },
        beforeDestroy: function () {
            window.clearInterval(this.interval);
            window.clearInterval(this.interval2);
        },
        methods: {
            changetime:function() {
                this.nowtime = getNowFormatDate();
            },
            //页面初始化接口 => 接口3
            init: function () {
                //一部分数据
                var self = this;
             
                this.getPublicBord()
                self.getPublicList()
                self.personMessage()
                self.interval = window.setInterval(function () {
                    self.getPublicBord()
                    self.getPublicList()
                    self.personMessage()
                    
                }, 20000);


                self.interval2 = window.setInterval(function () {
                    if(self.time.seconds <= 0){
                        self.time.seconds = 60
                        if(self.time.minutes >0){
                            self.time.minutes --
                        }else{
                            self.time.minutes = 59
                            if(self.time.hours>0){
                                self.time.hours --
                            }else{
                                self.time.hours = 24
                            }
                        }
                    }
                    self.time.seconds--
                    self.isQiandao = self.time.hours +'小时'+ self.time.minutes +'分钟'+ self.time.seconds+'秒' 
                }, 1000);
                
            },
             //public => 今日看板
            getPublicBord(){
                var self = this
                http2({
                    url: config + '/api/public/board',
                    dataType: 'json',
                }).then(function (res) {
                    if(res.status == 200){
                        self.initData.currentParticipateCount = res.data.currentParticipateCount;

                        self.initData.currentTotalMoney = res.data.currentTotalMoney/100;
                        self.initData.hitClock = res.data.hitClock;
                        self.initData.notHitClock = res.data.notHitClock;
                        self.isPay = res.data.needPay

                        self.isQiandao = res.data.leftTime
                        //处理时间
                        var time  = self.isQiandao //14小时11分钟9秒
                        var b1 = time.indexOf('小')
                        var b2 = time.indexOf('时')
                        var b3 = time.indexOf('分')
                        var b4 = time.indexOf('钟')
                        var b5 = time.indexOf('秒')
                        var h = 0 
                        var m = 0
                        var s = 0

                        var h = time.substring(0,b1)
                        var m = time.substring(b2+1,b3)
                        var s = time.substring(b4+1,b5)

                        self.time.hours = parseInt(h)
                        self.time.minutes = parseInt(m)
                        self.time.seconds = parseInt(s)
                    }
                });
            },
            //public => 最新加入用户列表
            getPublicList(){
                var self = this
                http2({
                    url: config + '/api/public/last',
                    dataType: 'json',
                }).then(function (res) {
                    if(res.status == 200){
                        var arr  = res.data.persons;
                        if(arr){
                            for(var i= 0;i<arr.length;i++){
                                if(arr[i].headImg == '../images/jia2.jpg'){
                                    arr[i].headImg = 'img/jia2.jpg'
                                }
                            }
                        }
                        self.initData.headlist = arr

                    }
                });
            },
            //同意规则并支付
            agreedFunc(){
                window.location.href('pay.html')
            },
            //个人信息(开板)
            personMessage(){
                var self = this
                http({
                    url: config+'/api/person/board/'+openid
                }).then(function(res){
                    var data = res.data
                    if(data.todayTime){
                        self.clock = false
                    }else{
                        self.clock = true
                    }
                    if(data.paid/100 > -1){
                        self.isMyPay = true // 同意规则改这里
                        self.alreadyPay = true
                        self.alreadyMoney = data.paid/100
                    }else{
                        self.isMyPay = true
                        self.alreadyPay = false
                    }
                })
            },
            //页面加载完之后调用
            updata(){
                var dataJson={
                    openid:openid,
                    nickname:'神秘人' + openid.substring(20),
                    headImg:'../images/jia2.jpg',
                }
                debugger
                http({
                    url: config+'/api/person/update',
                    method: 'post',
                    data: dataJson
                }).then(function(res){
                    debugger
                    var data = res.data
                })
            },
            goTo: function (path) {
                this.$router.push(path);
            },
            getPayData: function (money) {
                var self = this;
                if(!money && this.initData.config.pay_list) {
                    var paylist = this.initData.config.pay_list;
                    var list = [];
                    for(var i=0;i<paylist.length;i++){
                        var a = i;
                        list.push({
                            label: paylist[i].name,
                            onClick: (function (i) {
                                return function () {
                                    self.getPayData(i);
                                }
                            })(paylist[i].value)
                        });
                    }
                    weui.actionSheet(list, [
                        {
                            label: '取消',
                            onClick: function () {
                            }
                        }
                    ]);
                    return false;
                }
                // select 选择支付金额 => 接口4
                money = money * 100
                
                http({
                    url: config + '/api/security/pay/'+openid+'/'+money+'',
                }).then(function (res) {
                    if (res.status == 200) {
                        var data = res.data;
                        self.pay(data);
                    } else if(res.ret == 1) {
                        layer.open({
                            type: 2,
                            content: res.message
                        });
                        location.href = res.url;
                    }else{
                        weui.alert(res.message);
                    }
                });
            },
            payzhujia:function(money){
                var self = this;
                if(!money && this.initData.config.pay_list) {
                    var paylist = this.initData.config.pay_list;
                    var list = [];
                    for(var i=0;i<paylist.length;i++){
                        var a = i;
                        list.push({
                            label: paylist[i].name,
                            onClick: (function (i) {
                                return function () {
                                    self.payzhujia(i);
                                }
                            })(paylist[i].value)
                        });
                    }
                    weui.actionSheet(list, [
                        {
                            label: '取消',
                            onClick: function () {
                            }
                        }
                    ]);
                    return false;
                }
                http({
                    url: baseUrl + 'getzhuijia&money='+money
                })
                .then(function (res) {
                    res = res.data;
                    console.log(res);
                    if (res.ret == 0) {
                        var data = res.data;
                        self.pay(data);
                    } else if(res.ret == 1) {
                        layer.open({
                            type: 2,
                            content: res.message
                        });
                        location.href = res.url;
                    }else{
                        weui.alert(res.message);
                    }
                });
            },
            pay: function (data) {
                var self = this;
                
                util.pay({
                    orderFee: data.orderFee,
                    payMethod: 'wechat',
                    orderTitle: data.orderTitle,
                    orderTid: data.orderTid,
                    module: data.module,
                    success: function (result) {
                        console.log(result);
                        //alert('支付成功');
                    },
                    fail: function (result) {
                        //alert('fail : ' + result.message);
                    },
                    complete: function (result) {
                        location.reload();
                    }
                });
            },
            daka: function (option) {
                var self = this;
                http({
                    url: config + '/api/security/clock/'+openid,
                    
                }).then(function (res) {
                    
                    res = res.data;
                    if (res.status == 200) {
                        self.showcode = true;
                        var config={
                            vid:res.data.vid, //验证单元id, string, 必填
                            challenge:res.data.challenge, //验证流水号, string, 必填
                            container:"#vaptcha_container",//验证码容器, HTMLElement或者selector, 必填
                            type:"invisible", //必填，表示点击式验证模式
                            ai:false,
                            outage:"sd", //服务器端配置的宕机模式接口地址
                            success:function(token,challenge){
                                //验证成功回调函数, 参数token, challenge 为string, 必填
                                //todo:执行人机验证成功后的操作
                                self.showcode = false;
                                self.daka({
                                    token:token,
                                    challenge:challenge
                                });
                            },
                            fail:function(){//验证失败回调函数  
                                //todo:执行人机验证失败后的操作
                                console.log('fail');
                            }
                        }
                        var obj;
                        window.vaptcha(config,function(vaptcha_obj){
                            obj = vaptcha_obj;
                            obj.validate();
                        });
                        return false;
                    }
                    layer.open({
                        content: '打卡成功',
                        btn: ['确定'],
                        yes: function () {
                            //layer.closeAll();
                            //self.getPayData();
                            location.reload();
                        },
                        no: function () {
                            location.reload();
                        }
                    });
                });
            },
            showRule: function () {
                var content = '<div style="text-align:left;">' +
                   /*  '支付10元加入挑战<br>' +
                    '早上06:30-07:00打卡<br>' +
                    '准时打卡的人平分挑战金<br>' + */
                    '1.每日打卡时间为6:30-7:00；<br>2.打卡挑战者瓜分未打卡挑战者挑战金；<br>3.打卡挑战者按照1元每份额瓜分未打卡挑战者挑战金，支付挑战金越高，瓜分奖励金也就越高；<br>4.单账户最低支付十元，最高追加五千元挑战金，奖励金满1元可提现，无手续费；<br>5.因未准时打卡，导致挑战金被瓜分后，再次参与挑战需重新支付挑战金；<br>6.挑战金支付后，连续打卡满21天，即可自主退回挑战金，亦可继续参与挑战；<br>7.打卡遇到任何问题，请在当日打卡时间内联系客服并提供截图；<br>8.打卡成功以后，公众号会发送打卡成功的提示信息，若未收到提示信息，须在打卡时间内联系客服提供id报备；<br>9.挑战过程中，如所有参与者全部打卡的，平台会酌情给与打卡者适当补贴；<br>10.“你能早起吗”平台旨在倡导大家养成早起好习惯，平台仅供娱乐参与；<br>11.关于规则详细解读，请查看[联系客服]页面[常见问题]。' +
                    '</div>';
                layer.open({
                    anim: 'up',
                    content: content,
                    btn: ['确认']
                });
            },
            showzhanji: function () {
                var load1 = layer.open({type: 2});
                http({
                    url: baseUrl + 'gethaibao',
                }).then(function(res){
                    layer.close(load1);
                    res = res.data;
                    var content = '<div style="position:relative;">'+'<img style="width:100%;" id="zhanjiimg" src="'+res.data+'">'+
                            '<div onclick="closeLayer()" style="border-radius:100%;position:absolute;top:-15px;right:-15px;border:1px solid #ededed;background:#000;height:30px;line-height:27px;width:30px;opacity:0.7;color:#fff;text-align:center;font-size:25px;">×</div></div>';
                        layer.open({
                            type: 1,
                            content: content,
                            anim: 'up',
                            style: 'position:fixed; left:5%; top:10%; width:90%; border: none; -webkit-animation-duration: .5s; animation-duration: .5s;'
                        });
                        var canvasHeight = $('#zhanjiimg').height();
                        $('.layui-m-layercont').css('height',canvasHeight+'px');
                        var load = layer.open({type: 2});
                        var img = new Image();
                        img.src = res.data;
                        img.onload = function () {
                            layer.close(load);
                        }
                })
            }
        }
    });
    function closeLayer () {
        layer.closeAll();
    }
    
    </script>
    
    <script>
    //里面有一个top
    var indexBottom = Vue.component('index-bottom',{
        template: '#bottom',
        data: function () {
            return {
                msg: 'hello',
                dakalist: [],
                offset: 10,
                num:10,
                showmore: false,
                calc:false,
                isShow:true,
                star:{
                    zaoqi:{
                        fans:{
                            nickname:'',
                            headimgurl:'',
                        },
                        checked_time:'',
                    },
                    lianxu:{
                        fans:{
                            nickname:'',
                            headimgurl:'',
                        },
                        lianxu:'',
                    }
                },
            }
        },
        created: function () {
            this.init();
        },
        methods: {
            init: function () {
                this.getstar();
            },
            //请求今日之星 =>接口2. 
            getstar: function () {
                var self = this;
                http({
                    url: config + '/api/public/board',
                    dataType: 'json',
                }).then(function (res) {
                     var data = res.data
                    if(res.status == 200){
                        if(self.calc==true){
                            self.isShow=true    
                        }else{
                            self.isShow=false
                        }
                        self.calc = data.calc
                        //早起之星
                        self.star.zaoqi.fans.nickname = data.earlyStar.nickname
                        self.star.zaoqi.checked_time = data.earlyTime
                        self.star.zaoqi.fans.headimgurl = data.earlyStar.headImg
                        
                        //毅力之星
                        self.star.lianxu.fans.nickname = data.staminaStar.nickname
                        self.star.lianxu.lianxu = data.staminaStar.staminaCount
                        self.star.lianxu.fans.headimgurl = data.staminaStar.headImg
                        
                    }
                });
            },
        }
    })
</script>
<script>
    //用户列表 => 排行榜
    var userList = Vue.component('user-list',{
        template: '#userList',
        data: function () {
            return {
                msg: 'hello',
                dakalist: [],
                offset: 0,
                num:10,
                showmore: false,
                star:{
                    zaoqi:{
                        fans:{
                            nickname:'',
                            headimgurl:'',
                        },
                        checked_time:'',
                    },
                    lianxu:{
                        fans:{
                            nickname:'',
                            headimgurl:'',
                        },
                        lianxu:'',
                    }
                }
            }
        },
        created: function () {
            this.init();
        },
        mounted:function() {
            var self = this;
            $(window).scroll(function(){
            　　var scrollTop = $(this).scrollTop();
            　　var scrollHeight = $(document).height();
            　　var windowHeight = $(this).height();
                
            　　if(scrollTop + windowHeight == scrollHeight){
                    if(self.showmore) {
                        if(self.$route.path=='/list') {
                            self.getmore();
                        }
                    }
            　　}
            });
        },
        methods: {
            init: function () {
                this.getmore();
            },
            // 请求底部的list =>接口1
            getmore: function () {
                var self = this;
                http({
                    url: config + '/api/public/rich/'+self.num+'/'+self.offset+'',
                    dataType: 'json',
                }).then(function(res){
                    var data = res.data.persons
                    if(data) {
                        // debugger
                        if(res.data.hasNext) {
                            self.showmore = true;
                        }else{
                            self.showmore = false;
                        }
                        for(var i=0;i< data.length;i++) {
                            if(data[i].headImg == ''){
                                data[i].headImg = './img/headImg.png'
                            }else if(data[i].headImg == '../images/jia2.jpg'){
                                data[i].headImg = 'img/jia2.jpg'
                            }

                            self.dakalist.push(data[i]);
                            // console.log(data[i].headImg)
                            // // debugger
                        }
                        self.offset= self.offset+10
                    }else{
                        self.showmore = false;
                    }
                })
            }
        }
    })
</script>
<style>
    .weui-media-box__title{
        overflow: visible;
        font-size: 14px;
    }                                
</style>
<style>
</style>
<script type="text/x-template" id='lianxu-index'>
    <div id="lianxu">
        <div style="position:relative;">
            <img src="img/view.png" style="width:100%">
        </div>
        <div  class="detail"></div>
    </div>
</script>
<script>
    var lianxuIndex = Vue.component('lianxu-index', {
        template: '#lianxu-index',
        data: function () {
            return {
                id: '',
                lianxu: {},
            }
        },
        created: function () {
            if(this.$route.query.id) {
                this.id = this.$route.query.id;
            }
            console.log(this.config);
        },
        mounted: function () {
        },
        methods: {
            
        }
    });
</script><style>
</style>
<script type="text/x-template" id='lianxu-rule'>
    <div id="lianxu">
        <div  class="detail">1.每日打卡时间为6:30-7:00；
2.打卡挑战者瓜分未打卡挑战者挑战金；
3.打卡挑战者按照1元每份额瓜分未打卡挑战者挑战金，支付挑战金越高，瓜分奖励金也就越高；
4.单账户最低支付十元，最高追加五千元挑战金，奖励金满1元可提现，无手续费；
5.因未准时打卡，导致挑战金被瓜分后，再次参与挑战需重新支付挑战金；
6.挑战金支付后，连续打卡满21天，即可自主退回挑战金，亦可继续参与挑战；
7.打卡遇到任何问题，请在当日打卡时间内联系客服并提供截图；
8.打卡成功以后，公众号会发送打卡成功的提示信息，若未收到提示信息，须在打卡时间内联系客服提供id报备；
9.挑战过程中，如所有参与者全部打卡的，平台会酌情给与打卡者适当补贴；
10.“你能早起吗”平台旨在倡导大家养成早起好习惯，平台仅供娱乐参与；
11.关于规则详细解读，请查看[联系客服]页面[常见问题]。</div>
    </div>
</script>
<script>
    var lianxurule = Vue.component('lianxu-rule', {
        template: '#lianxu-rule',
        data: function () {
            return {
                id: '',
                lianxu: {},
            }
        },
        created: function () {
            if(this.$route.query.id) {
                this.id = this.$route.query.id;
            }
            console.log(this.config);
        },
        mounted: function () {
        },
        methods: {
            
        }
    });
</script>
<!-- 个人中心 -->
<script type="text/x-template" id='my-index'>
    <div>
        <my-top></my-top>
        <calendar :events="events" :selects="selects"></calendar>
    </div>
</div>
</script>
<style>
    .my-head{
        background-image: -webkit-linear-gradient(top,#175D7A 2%,#298492 50%,#3DABAF 99%);
        background-image: linear-gradient(-180deg,#175D7A 2%,#298492 50%,#3DABAF 99%);
        position: relative;
    }
    .top-item {
        padding:10px 0px;
        color:#fff;
        text-align:center;
    }
    .top-number {
        font-size:18px;
        color:#fff;
    }
    .top-text {
        font-size:10px;
        color:#fff;
    }
    .money {
        color: #1cc721;
        font-size: 50px;
        padding: 0px 0;
        font-family: DINAlternate-Bold;
        text-align:center;
    }
</style>
<script type="text/x-template" id='mytop'>
    <div  class="page__bd page__bd_spacing my-head">
        <div style="color:#fff;font-size:17px;margin:0 auto;text-align:center;padding-top:20px;">
            累计奖励(元)
        </div>
        <div class="money" style="color: #fff;"><router-link style="color: #fff;" to="/xiaji/908">{{person.totalReward}}</router-link></div>

      <!--   <div class="weui-flex" >
                <div style="text-align:center" class="weui-flex__item">
                    <span style="margin-right:-15px;" class="weui-btn weui-btn_mini ">我的投入:{{initData.pay_money}}</span>
                    <router-link to="/paylog" class="weui-btn weui-btn_mini weui-btn_primary">记录</router-link>
                </div>
                <div style="text-align:center"  class="weui-flex__item">
                    <span style="margin-right:-15px;" class="weui-btn weui-btn_mini ">余额:{{initData.money}}</span>
                    <router-link to="/atm" class="weui-btn weui-btn_mini weui-btn_primary">提现</router-link>
                </div>
            </div> -->

        <div style="color:#fff;font-size:17px;margin:0 auto;text-align:center;padding-top:20px;">
            我的信息
        </div>
        <div class="weui-flex" style="padding:10px 10px;">
            <div class="weui-flex__item">
                <div class="placeholder top-item">
                    <span class="top-number">{{person.id}}</span>
                    <div class="top-text">我的ID</div>
                </div>
            </div>
            <div class="weui-flex__item top-item">
                <div class="placeholder">
                    <span class="top-number">{{person.staminaCount}}</span>
                    <div class="top-text">连续打卡天数(天)</div>
                </div>
            </div>
        </div>
        <div class="weui-flex" style="padding:10px 10px;">
            <router-link to="/paylog"  class="weui-flex__item">
                <div class="placeholder top-item">
                    <span class="top-number">{{person.paid}}</span>
                    <div class="top-text">我的投入(元)</div>
                </div>
            </router-link >
            <router-link to="/atm" class="weui-flex__item top-item">
                <div class="placeholder">
                    <span class="top-number">{{person.cash}}</span>
                    <div class="top-text">我的余额(元)</div>
                </div>
            </router-link >
        </div>

        <div style="color:#fff;font-size:17px;margin:0 auto;text-align:center;padding-top:20px;">
            今日统计
        </div>
        
        <div class="weui-flex" style="padding:0px 10px;">
            <div class="weui-flex__item top-item">
                    <div class="placeholder">
                        <span class="top-number">{{person.hitMoney}}</span>
                        <div class="top-text">已打卡金额(元)</div>
                    </div>
                </div>
            <div class="weui-flex__item top-item">
                <div class="placeholder">
                    <span class="top-number">{{person.notHitMoney}}</span>
                    <div class="top-text">未打卡金额(元)</div>
                </div>
            </div>
        </div>
    </div>
</script>
<script>
    var indexTop = Vue.component('my-top',{
        template: '#mytop',
        data:function() {
            return {
                initData:{
                    allin:0,
                    alldaka:0,
                    allmoney:0,
                    score:0,
                    money:0,
                    tongji:{
                        failcount:0,
                        failpay:0,
                        qian:0,
                        successcount:0,
                        sucesspay:0,
                        zanzhu:0
                    }
                },
                person:{
                    staminaCount:0,
                    id:'',
                    totalReward:0,
                    cash:0,
                    paid:0,
                    hitMoney:0,
                    notHitMoney:0,
                }
            }
        },
        created: function () {
            this.getInit();
        },
        methods: {
            getInit: function () {
                var self = this;
                //个人信息四个 
                http({
                    url: config+'/api/person/board/'+openid
                }).then(function(res){
                    var data = res.data
                    self.person.staminaCount = data.staminaCount
                    self.person.id = data.id
                    self.person.totalReward = data.totalReward/100
                    self.person.cash = data.cash/100
                    personCash = data.cash/100
                    self.person.paid = data.paid/100
                })
                //今日统计俩值
                http({
                    url: config + '/api/public/board',
                    dataType: 'json',
                }).then(function (res) {
                    var data = res.data
                    self.person.hitMoney = data.hitMoney/100
                    self.person.notHitMoney = data.notHitMoney/100
                });
            }
        }
    })
</script> 
<script type="text/javascript" src="js/calendar.js"></script>
<script type="text/x-template" id='calendar'>
        <div class="calendar">
            <div class="calendar-tools">
                <span class="calendar-prev" @click="prev">
                    <svg width="20" height="20" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
                    <g class="transform-group">
                        <g transform="scale(0.015625, 0.015625)">
                            <path d="M671.968 912c-12.288 0-24.576-4.672-33.952-14.048L286.048 545.984c-18.752-18.72-18.752-49.12 0-67.872l351.968-352c18.752-18.752 49.12-18.752 67.872 0 18.752 18.72 18.752 49.12 0 67.872l-318.016 318.048 318.016 318.016c18.752 18.752 18.752 49.12 0 67.872C696.544 907.328 684.256 912 671.968 912z" fill="#5e7a88"></path>
                        </g>
                    </g>
                    </svg>
                </span>
                <span class="calendar-next"  @click="next">
                    <svg width="20" height="20" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
                    <g class="transform-group">
                        <g transform="scale(0.015625, 0.015625)">
                            <path d="M761.056 532.128c0.512-0.992 1.344-1.824 1.792-2.848 8.8-18.304 5.92-40.704-9.664-55.424L399.936 139.744c-19.264-18.208-49.632-17.344-67.872 1.888-18.208 19.264-17.376 49.632 1.888 67.872l316.96 299.84-315.712 304.288c-19.072 18.4-19.648 48.768-1.248 67.872 9.408 9.792 21.984 14.688 34.56 14.688 12 0 24-4.48 33.312-13.44l350.048-337.376c0.672-0.672 0.928-1.6 1.6-2.304 0.512-0.48 1.056-0.832 1.568-1.344C757.76 538.88 759.2 535.392 761.056 532.128z" fill="#5e7a88"></path>
                        </g>
                    </g>
                    </svg>
                </span>
                <div class="calendar-info" @click.stop="changeYear">
                    <!-- {{monthString}} -->
                    <div class="month">
                        <div class="month-inner" :style="{'top':-(this.month*20)+'px'}">
                            <span v-for="m in months">{{m}}</span>
                        </div>
                    </div>
                    <div class="year">{{year}}</div>
                </div>
            </div>
            <table cellpadding="5">
            <thead>
                <tr>
                    <td v-for="week in weeks" class="week">{{week}}</td>
                </tr>
            </thead>
            <tbody>
            <tr v-for="(day,k1) in days" style="{'animation-delay',(k1*30)+'ms'}">
                <td v-for="(child,k2) in day" 
                    :class="{'selected':child.eventName!=undefined}"
                    @click="select(k1,k2,$event)">
                    <span :class="{'red':k2==0||k2==6||((child.isLunarFestival||child.isGregorianFestival) && lunar)}">{{child.day}}</span>
                    <span class="myMoney" style="white-space:nowrap" v-if="child.money">{{child.money}}</span>
                    <div class="text" v-if="child.eventName!=undefined">{{child.eventName}}</div>
                    <div class="text" :class="{'isLunarFestival':child.isLunarFestival,'isGregorianFestival':child.isGregorianFestival}" v-if="lunar">{{child.lunar}}</div>
                </td>
            </tr>
            
            </tbody>
            </table>
    
            <div class="calendar-years" :class="{'show':yearsShow}">
                <span v-for="y in years" @click.stop="selectYear(y)" :class="{'active':y==year}">{{y}}</span>
            </div>
     
        </div>
    </script>

<script>
 if (typeof Object.assign != 'function') {
  // Must be writable: true, enumerable: false, configurable: true
  Object.defineProperty(Object, "assign", {
    value: function assign(target, varArgs) { // .length of function is 2
      'use strict';
      if (target == null) { // TypeError if undefined or null
        throw new TypeError('Cannot convert undefined or null to object');
      }

      var to = Object(target);

      for (var index = 1; index < arguments.length; index++) {
        var nextSource = arguments[index];

        if (nextSource != null) { // Skip over if undefined or null
          for (var nextKey in nextSource) {
            // Avoid bugs when hasOwnProperty is shadowed
            if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
              to[nextKey] = nextSource[nextKey];
            }
          }
        }
      }
      return to;
    },
    writable: true,
    configurable: true
  });
}

Array.prototype.myForEach = function myForEach(callBack, context) {
    typeof context === "undefined" ? context = window : null;

    if ("forEach" in Array.prototype) {
        this.forEach(callBack, context);
        return;
    }

    //->不兼容处理
    for (var i = 0; i < this.length; i++) {
        typeof callBack === "function" ? callBack.call(context, this[i], i, this) : null;
    }
};
    //$2-2-{"day":17,"lunar":"廿八","isLunarFestival":false,"isGregorianFestival":false,"eventName":"$","selected":true}
    var calendarCom = Vue.component('calendar', {
        template: '#calendar',
        props: {
            value: {
                type: Array,
                default: function () {
                    return []
                }
            },
            begin: {
                type: Array,
                default: function () {
                    return []
                }
            },
            end: {
                type: Array,
                default: function () {
                    return []
                }
            },
            range: {
                type: Boolean,
                default: false
            },
            zero: {
                type: Boolean,
                default: false
            },
            lunar: {
                type: Boolean,
                default: false
            },
            weeks: {
                type: Array,
                default: function () {
                    return window.navigator.language.toLowerCase() == "zh-cn" ? ['日', '一', '二', '三', '四', '五', '六'] : ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
                }
            },
            months: {
                type: Array,
                default: function () {
                    return window.navigator.language.toLowerCase() == "zh-cn" ? ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'] : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
                }
            },
            events: {
                type: Object,
                default: function () {
                    return {};
                }
            },
            selects: {
                type: Array,
                default: function () {
                    return [];
                }
            }
        },
        data: function () {
            return {
                years: [],
                yearsShow: false,
                year: 0,
                month: 0,
                day: 0,
                days: [],
                today: [],
                festival: {
                    lunar: {
                        "1-1": "春节",
                        "1-15": "元宵节",
                        "2-2": "龙头节",
                        "5-5": "端午节",
                        "7-7": "七夕节",
                        "7-15": "中元节",
                        "8-15": "中秋节",
                        "9-9": "重阳节",
                        "10-1": "寒衣节",
                        "10-15": "下元节",
                        "12-8": "腊八节",
                        "12-23": "祭灶节",
                    },
                    gregorian: {
                        "1-1": "元旦",
                        "2-14": "情人节",
                        "3-8": "妇女节",
                        "3-12": "植树节",
                        "4-5": "清明节",
                        "5-1": "劳动节",
                        "5-4": "青年节",
                        "6-1": "儿童节",
                        "7-1": "建党节",
                        "8-1": "建军节",
                        "9-10": "教师节",
                        "10-1": "国庆节",
                        "12-24": "平安夜",
                        "12-25": "圣诞节",
                    },
                },
                rangeBegin: [],
                rangeEnd: [],
                userMoney:[],
            }
        },
        watch: {
            events: function () {
                this.render(this.year, this.month);
            }
        },
        created:function(){
            this.init();
        },
        mounted: function () {
            
        },
        methods: {
            getMoney:function(temp,time){
                var self  = this
                http({
                    url: config+'/api/person/rewardBoard/'+ openid+'/'+time,
                }).then(function(res){
                    var data = res.data
                    var arr =[]
                    if(data.length>0){
                        for(var i = 0;i<data.length;i++){
                            arr[i] = {}
                            arr[i].day = data[i].d
                            if(data[i].reward){
                                arr[i].money = data[i].reward/100
                            }
                        }
                    }
                    if(temp){
                        
                        for(var i = 0;i<temp.length;i++){
                            for(var j= 0;j < temp[i].length;j++){
                                for(var k =0;k<arr.length;k++){
                                    if((i==0 && temp[i][j].day>8)||(i==4&&temp[i][j].day <8)){
                                       break
                                    }
                                    if(temp[i][j].day ==arr[k].day){

                                        arr[k].money >0 ? temp[i][j].money = arr[k].money +'元' : temp[i][j].money ='未发放'
                                    }
                                    
                                }
                            }
                        }
                    }
                    self.days = temp
                })       
            },
            isSelect: function (day) {
                var year = this.year;
                var month = this.month+1;
                var arr;
                for(var i=0;i<this.selects.length;i++) {
                    arr = this.selects[i].split('-');
                    var bool = window.parseInt(arr[0])==year && window.parseInt(arr[1])==month && window.parseInt(arr[2])==day;
                    if(bool) {
                        return true;
                    }
                }
                return false;
            },
            // 初始化一些东西
            init: function () {
                var now = new Date();
                // 没有默认值
                this.year = now.getFullYear();
                this.month = now.getMonth();
                this.day = now.getDate();
                if (this.value.length > 0) {
                    if (this.range) {
                        this.year = parseInt(this.value[0][0]);
                        this.month = parseInt(this.value[0][1]) - 1;
                        this.day = parseInt(this.value[0][2]);

                        var year2 = parseInt(this.value[1][0]);
                        var month2 = parseInt(this.value[1][1]) - 1;
                        var day2 = parseInt(this.value[1][2]);

                        this.rangeBegin = [this.year, this.month, this.day];
                        this.rangeEnd = [year2, month2, day2];
                        // console.log(this.month,this.rangeBegin,this.rangeEnd)
                    } else {
                        this.year = parseInt(this.value[0]);
                        this.month = parseInt(this.value[1]) - 1;
                        this.day = parseInt(this.value[2]);
                    }
                }
                this.render(this.year, this.month);
            },
            // 渲染日期
            render: function(y, m) {
                var _m = m+1<10? 0+ (m+1).toString(): (m+1).toString()
                var time  = y.toString() + _m

                var firstDayOfMonth = new Date(y, m, 1).getDay();        //当月第一天
                var lastDateOfMonth = new Date(y, m + 1, 0).getDate();    //当月最后一天
                var lastDayOfLastMonth = new Date(y, m, 0).getDate();     //最后一月的最后一天
                this.year = y;

                var sevarSplit = this.value;
                var i, line = 0, temp = [], nextMonthPushDays = 1;
                for (i = 1; i <= lastDateOfMonth; i++) {
                    var day = new Date(y, m, i).getDay(); //返回星期几（0～6）
                    var k;
                    // 第一行
                    if (day == 0) {
                        temp[line] = [];
                    } else if (i == 1) {
                        temp[line] = [];
                        k = lastDayOfLastMonth - firstDayOfMonth + 1;
                        for (var j = 0; j < firstDayOfMonth; j++) {
                            // console.log("第一行",lunarYear,lunarMonth,lunarValue,lunarInfo)
                            temp[line].push(Object.assign(
                                { day: k, disabled: true },
                                this.getLunarInfo(this.computedPrevYear(), this.computedPrevMonth(true), k),
                                this.getEvents(this.computedPrevYear(), this.computedPrevMonth(true), k)
                            ));
                            k++;
                        }
                    }

                    // 范围
                    if (this.range) {
                        // console.log("日期范围",this.getLunarInfo(this.year,this.month+1,i))
                        var options = Object.assign(
                            { day: i },
                            this.getLunarInfo(this.year, this.month + 1, i),
                            this.getEvents(this.year, this.month + 1, i)
                        );
                        if (this.rangeBegin.length > 0) {
                            var beginTime = Number(new Date(this.rangeBegin[0], this.rangeBegin[1], this.rangeBegin[2]));
                            var endTime = Number(new Date(this.rangeEnd[0], this.rangeEnd[1], this.rangeEnd[2]));
                            var stepTime = Number(new Date(this.year, this.month, i));
                            if (beginTime <= stepTime && endTime >= stepTime) {
                                options.selected = true;
                            }
                        }
                        if (this.begin.length > 0) {
                            var beginTime = Number(new Date(parseInt(this.begin[0]), parseInt(this.begin[1]) - 1, parseInt(this.begin[2])));
                            if (beginTime > Number(new Date(this.year, this.month, i))) {
                                options.disabled = true;
                            }
                        }
                        if (this.end.length > 0) {
                            var endTime = Number(new Date(parseInt(this.end[0]), parseInt(this.end[1]) - 1, parseInt(this.end[2])));
                            if (endTime < Number(new Date(this.year, this.month, i))) options.disabled = true;
                        }
                        temp[line].push(options);
                    } else {
                        // console.log(this.lunar(this.year,this.month,i));
                        // 单选模式
                        var chk = new Date();
                        var chkY = chk.getFullYear();
                        var chkM = chk.getMonth();
                        // 匹配上次选中的日期
                        if (parseInt(sevarSplit[0]) == this.year && parseInt(sevarSplit[1]) - 1 == this.month && parseInt(sevarSplit[2]) == i) {
                            // console.log("匹配上次选中的日期",lunarYear,lunarMonth,lunarValue,lunarInfo)
                            temp[line].push(Object.assign(
                                { day: i, selected: true },
                                this.getLunarInfo(this.year, this.month + 1, i),
                                this.getEvents(this.year, this.month + 1, i)
                            ))
                            this.today = [line, temp[line].length - 1];
                        }
                        // 没有默认值的时候显示选中今天日期
                        else if (chkY == this.year && chkM == this.month && i == this.day && this.value == "") {

                            // console.log("今天",lunarYear,lunarMonth,lunarValue,lunarInfo)
                            temp[line].push(Object.assign(
                                { day: i, selected: true },
                                this.getLunarInfo(this.year, this.month + 1, i),
                                this.getEvents(this.year, this.month + 1, i)
                            ));
                            this.today = [line, temp[line].length - 1];
                        } else {
                            // 普通日期
                            // console.log("设置可选范围",i,lunarYear,lunarMonth,lunarValue,lunarInfo)
                            var options = Object.assign(
                                { day: i, selected: false },
                                this.getLunarInfo(this.year, this.month + 1, i),
                                this.getEvents(this.year, this.month + 1, i)
                            );
                            if (this.begin.length > 0) {
                                var beginTime = Number(new Date(parseInt(this.begin[0]), parseInt(this.begin[1]) - 1, parseInt(this.begin[2])));
                                if (beginTime > Number(new Date(this.year, this.month, i))) options.disabled = true;
                            }
                            if (this.end.length > 0) {
                                var endTime = Number(new Date(parseInt(this.end[0]), parseInt(this.end[1]) - 1, parseInt(this.end[2])));
                                if (endTime < Number(new Date(this.year, this.month, i))) options.disabled = true;
                            }
                            temp[line].push(options);
                        }
                    }
                    // 到周六换行
                    if (day == 6 && i < lastDateOfMonth) {
                        line++;
                    } else if (i == lastDateOfMonth) {
                        // line++
                        var k = 1;
                        for (var d = day; d < 6; d++) {
                            // console.log(this.computedNextYear()+"-"+this.computedNextMonth(true)+"-"+k)
                            temp[line].push(Object.assign(
                                { day: k, disabled: true },
                                this.getLunarInfo(this.computedNextYear(), this.computedNextMonth(true), k),
                                this.getEvents(this.computedNextYear(), this.computedNextMonth(true), k)
                            ));
                            k++;
                        }
                        // 下个月除了补充的前几天开始的日期
                        nextMonthPushDays = k;
                    }
                } //end for

                // console.log(this.year+"/"+this.month+"/"+this.day+":"+line)
                // 补充第六行让视觉稳定
                // if (line <= 5 && nextMonthPushDays > 0) {
                //     // console.log({nextMonthPushDays:nextMonthPushDays,line:line})
                //     for (var i = line + 1; i <= 5; i++) {
                //         temp[i] = [];
                //         var start = nextMonthPushDays + (i - line - 1) * 7;
                //         for (var d = start; d <= start + 6; d++) {
                //             temp[i].push(Object.assign(
                //                 { day: d, disabled: true },
                //                 this.getLunarInfo(this.computedNextYear(), this.computedNextMonth(true), d),
                //                 this.getEvents(this.computedNextYear(), this.computedNextMonth(true), d)
                //             ));
                //         }
                //     }
                // }
                
                this.getMoney(temp,time);
            },
            computedPrevYear: function () {
                var value = this.year;
                if (this.month - 1 < 0) {
                    value--;
                }
                return value;
            },
            computedPrevMonth: function(isString) {
                var value = this.month;
                if (this.month - 1 < 0) {
                    value = 11;
                } else {
                    value--;
                }
                // 用于显示目的（一般月份是从0开始的）
                if (isString) {
                    return value + 1;
                }
                return value;
            },
            computedNextYear: function () {
                var value = this.year;
                if (this.month + 1 > 11) {
                    value++;
                }
                return value;
            },
            computedNextMonth: function(isString) {
                var value = this.month;
                if (this.month + 1 > 11) {
                    value = 0;
                } else {
                    value++;
                }
                // 用于显示目的（一般月份是从0开始的）
                if (isString) {
                    return value + 1;
                }
                return value;
            },
            // 获取农历信息
            getLunarInfo: function(y, m, d) {
                // var lunarInfo = calendar.solar2lunar(y, m, d);
                // var lunarValue = lunarInfo.IDayCn;
                // // console.log(lunarInfo)
                // var isLunarFestival = false;
                // var isGregorianFestival = false;
                // if (this.festival.lunar[lunarInfo.lMonth + "-" + lunarInfo.lDay] != undefined) {
                //     lunarValue = this.festival.lunar[lunarInfo.lMonth + "-" + lunarInfo.lDay];
                //     isLunarFestival = true;
                // } else if (this.festival.gregorian[m + "-" + d] != undefined) {
                //     lunarValue = this.festival.gregorian[m + "-" + d];
                //     isGregorianFestival = true;
                // }
                // return {
                //     lunar: lunarValue,
                //     isLunarFestival: isLunarFestival,
                //     isGregorianFestival: isGregorianFestival,
                // }
            },
            // 获取自定义事件
            getEvents: function(y, m, d) {
                if (Object.keys(this.events).length == 0) {
                    return false;
                }
                if (this.events[y + "-" + m + "-" + d] != undefined) {
                    return {
                        eventName: this.events[y + "-" + m + "-" + d]
                    };
                }
                return {};
            },
            // 上月
            prev: function(e) {
                e.stopPropagation()
                if (this.month == 0) {
                    this.month = 11;
                    this.year = parseInt(this.year) - 1;
                } else {
                    this.month = parseInt(this.month) - 1;
                }
                this.render(this.year, this.month);
            },
            //  下月
            next: function(e) {
                e.stopPropagation();
                if (this.month == 11) {
                    this.month = 0;
                    this.year = parseInt(this.year) + 1;
                } else {
                    this.month = parseInt(this.month) + 1;
                }
                this.render(this.year, this.month);
            },
            // 选中日期
            select: function(k1, k2, e) {
                if (e != undefined) {
                    e.stopPropagation();
                }
                // 日期范围
                if (this.range) {
                    if (this.rangeBegin.length == 0 || this.rangeEndTemp != 0) {
                        this.rangeBegin = [this.year, this.month, this.days[k1][k2].day];
                        this.rangeBeginTemp = this.rangeBegin;
                        this.rangeEnd = [this.year, this.month, this.days[k1][k2].day];
                        this.rangeEndTemp = 0;

                    } else {
                        this.rangeEnd = [this.year, this.month, this.days[k1][k2].day];
                        this.rangeEndTemp = 1;
                        // 判断结束日期小于开始日期则自动颠倒过来
                        if (+new Date(this.rangeEnd[0], this.rangeEnd[1], this.rangeEnd[2]) < +new Date(this.rangeBegin[0], this.rangeBegin[1], this.rangeBegin[2])) {
                            this.rangeBegin = this.rangeEnd;
                            this.rangeEnd = this.rangeBeginTemp;
                        }
                        // 小于10左边打补丁
                        var begin = [];
                        var end = [];
                        if (this.zero) {
                            this.rangeBegin.forEach(function(v, k) {
                                if (k == 1) {
                                    v = v + 1;
                                }
                                begin.push(this.zeroPad(v));
                            })
                            this.rangeEnd.forEach(function(v, k)  {
                                if (k == 1){
                                    v = v + 1;
                                }
                                end.push(this.zeroPad(v));
                            })
                        } else {
                            begin = this.rangeBegin;
                            end = this.rangeEnd;
                        }
                        // console.log("选中日期",begin,end)
                        this.$emit('select', begin, end);
                    }
                    this.render(this.year, this.month);
                } else {
                    // 取消上次选中
                    if (this.today.length > 0) {
                        this.days.forEach(function(v) {
                            v.forEach(function(vv) {
                                vv.selected = false;
                            })
                        })
                    }
                    // 设置当前选中天
                    this.days[k1][k2].selected = true;
                    this.day = this.days[k1][k2].day;
                    this.today = [k1, k2];
                    this.$emit('select', [this.year, this.zero ? this.zeroPad(this.month + 1) : this.month + 1, this.zero ? this.zeroPad(this.days[k1][k2].day) : this.days[k1][k2].day]);
                }
            },
            changeYear: function () {
                if (this.yearsShow) {
                    this.yearsShow = false;
                    return false;
                }
                this.yearsShow = true;
                this.years = [];
                for (var i = ~~this.year - 10; i < ~~this.year + 10; i++) {
                    this.years.push(i);
                }
            },
            selectYear: function(value) {
                this.yearsShow = false;
                this.year = value;
                this.render(this.year, this.month);
            },
            // 日
            zeroPad: function(n) {
                return String(n < 10 ? '0' + n : n);
            },
        }
    });

</script>

<style scoped>
    .calendar {
        margin: auto;
        width: 100%;
        min-width: 300px;
        background: #fff;
        font-family: "PingFang SC", "Hiragino Sans GB", "STHeiti", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
        user-select: none;
    }

    .calendar-tools {
        height: 40px;
        font-size: 20px;
        line-height: 40px;
        color: #5e7a88;
    }

    .calendar-tools span {
        cursor: pointer;
    }

    .calendar-prev {
        width: 14.28571429%;
        float: left;
        text-align: center;
    }

    .calendar-info {
        padding-top: 3px;
        font-size: 16px;
        line-height: 1.3;
        text-align: center;
    }

    .calendar-info>div.month {
        margin: auto;
        height: 20px;
        width: 100px;
        text-align: center;
        color: #5e7a88;
        overflow: hidden;
        position: relative;
    }

    .calendar-info>div.month .month-inner {
        position: absolute;
        left: 0;
        top: 0;
        height: 240px;
        transition: top .5s cubic-bezier(0.075, 0.82, 0.165, 1);
    }

    .calendar-info>div.month .month-inner>span {
        display: block;
        font-size: 14px;
        height: 20px;
        width: 100px;
        overflow: hidden;
        text-align: center;
    }

    .calendar-info>div.year {
        font-size: 10px;
        line-height: 1;
        color: #999;
    }

    .calendar-next {
        width: 14.28571429%;
        float: right;
        text-align: center;
    }

    .calendar table {
        clear: both;
        width: 100%;
        margin-bottom: 10px;
        border-collapse: collapse;
        color: #444444;
    }

    .calendar td {
        margin: 2px !important;
        padding: 0px 0;
        width: 14.28571429%;
        height: 44px;
        text-align: center;
        vertical-align: middle;
        font-size: 14px;
        line-height: 125%;
        cursor: pointer;
        position: relative;
        vertical-align: top;
    }

    .calendar td.week {
        font-size: 10px;
        pointer-events: none !important;
        cursor: default !important;
    }

    .calendar td.disabled {
        color: #ccc;
        pointer-events: none !important;
        cursor: default !important;
    }

    .calendar td.disabled div {
        color: #ccc;
    }

    .calendar td span {
        display: block;
        max-width: 40px;
        height: 26px;
        font-size: 16px;
        line-height: 26px;
        margin: 0px auto;
        border-radius: 20px;
    }

    .calendar td:not(.selected) span:not(.red):hover {
        background: #f3f8fa;
        color: #444;
    }

    .calendar td:not(.selected) span.red:hover {
        background: #f9efef;
    }

    .calendar td:not(.disabled) span.red {
        color: #ea6151;
    }

    .calendar td.selected span {
        background-color: #5e7a88;
        color: #fff;
    }

    .calendar td .text {
        position: absolute;
        top: 28px;
        left: 0;
        right: 0;
        text-align: center;

        padding: 2px;
        font-size: 8px;
        line-height: 1.2;
        color: #444;
    }

    .calendar td .isGregorianFestival,
    .calendar td .isLunarFestival {
        color: #ea6151;
    }

    .calendar td.selected span.red {
        background-color: #ea6151;
        color: #fff;
    }

    .calendar td.selected span.red:hover {
        background-color: #ea6151;
        color: #fff;
    }

    .calendar thead td {
        text-transform: uppercase;
        height: 30px;
        vertical-align: middle;
    }

    .calendar-button {
        text-align: center;
    }

    .calendar-button span {
        cursor: pointer;
        display: inline-block;
        min-height: 1em;
        min-width: 5em;
        vertical-align: baseline;
        background: #5e7a88;
        color: #fff;
        margin: 0 .25em 0 0;
        padding: .6em 2em;
        font-size: 1em;
        line-height: 1em;
        text-align: center;
        border-radius: .3em;
    }

    .calendar-button span.cancel {
        background: #efefef;
        color: #666;
    }

    .calendar-years {
        position: absolute;
        left: 0px;
        top: 60px;
        right: 0px;
        bottom: 0px;
        background: #fff;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        overflow: auto;
        transition: all .5s cubic-bezier(0.075, 0.82, 0.165, 1);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-10px);
    }

    .calendar-years.show {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0px);
    }

    .calendar-years>span {
        margin: 1px 5px;
        display: inline-block;
        width: 60px;
        line-height: 30px;
        border-radius: 20px;
        text-align: center;
        border: 1px solid #fbfbfb;
        color: #999;
    }

    .calendar-years>span.active {
        border: 1px solid #5e7a88;
        background-color: #5e7a88;
        color: #fff;
    }
    .calendar .myMoney{
        font-size: 12px;
        color: #ccc;
    }
</style>
<script>
    var myIndex = Vue.component('my-index', {
        template: '#my-index',
        data: function (){
            return {
                events: {
                },
                selects: [],
            }
        },
        created: function () {
            var self = this;
            // var openid = 'oIvCJ5aexuwu19gmSc2p1lPN6_Ts'
            // http({
            //     url: config+'/api/person/board/'+openid
            // }).then(function(res){
            //     debugger
            //     // res = res.data;
            //     // if(res.ret==0) {
            //     //     var data = res.data;
            //     //     self.events = data.events;
            //     //     self.selects = data.selects;
            //     // }
            // })
        }
    })
</script>
<script type="text/x-template" id='my-atm'>
    <div>
        <div class="weui-tab">
            <div class="weui-navbar">
                <div @click="tabname='atm'" :class="tabname=='atm'?'weui-bar__item_on':''" class="weui-navbar__item ">
                    申请提现
                </div>
                <div @click="tabname='atmlog'" :class="tabname=='atmlog'?'weui-bar__item_on':''" class="weui-navbar__item">
                    资金流水
                </div>
            </div>
            <div v-if="tabname=='atm'" class="weui-tab__panel">
                <div style="margin-top:0;" class="weui-cells weui-cells_form">
                    <div class="weui-cell">
                        <div class="weui-cell__hd"><label class="weui-label">我的余额</label></div>
                        <div class="weui-cell__bd" style="display:flex;justify-content:space-around">
                            <input class="weui-input" :value="myCash" disabled style="width:calc(100% - 10px)">
                            <span>元</span>
                        </div>
                    </div>
                     <div class="weui-cell weui-cell_select weui-cell_select-after">
                        <div class="weui-cell__hd">
                            <label for="" class="weui-label">提现方式</label>
                        </div>
                        <div class="weui-cell__bd">
                            <select class="weui-select" v-model="atm.type" name="type">
                                <!--<option value="0">选择提现方式</option>-->
                                <option value="1">微信</option>
                                <!-- <option value="2">支付宝</option> -->
                            </select>
                        </div>
                    </div>
                    <div v-if="atm.type==2" class="weui-cell">
                        <div class="weui-cell__hd"><label class="weui-label">支付宝账号</label></div>
                        <div class="weui-cell__bd">
                            <input class="weui-input" v-model="atm.idnum" type="text" placeholder="请输入支付宝账号">
                        </div>
                    </div> 
                    <div class="weui-cell">
                        <div class="weui-cell__hd"><label class="weui-label">提现金额</label></div>
                        <div class="weui-cell__bd">
                            <input class="weui-input" v-model="atm.money" type="number" placeholder="请输入提现金额">
                        </div>
                    </div>
                </div>
                <div class="weui-btn-area">
                    <a @click="tixian" class="weui-btn weui-btn_primary" href="javascript:" id="showTooltips">确定</a>
                </div>
            </div>

            <div v-if="tabname=='atmlog'" class="weui-tab__panel">
                <div class="weui-panel">
                  <!--   <div class="weui-panel__hd">文字列表附来源</div> -->
                  <div class="weui-panel__bd">
                    <template v-for="item in atmlog.list">
                        <div class="weui-media-box weui-media-box_text">
                            <h4 class="weui-media-box__title">金额: {{item.cash/100}}元</h4>
                            <p class="weui-media-box__desc">
                                时间:{{item.dateCreated}}
                            </p>
                            <ul class="weui-media-box__info">
                                <li class="weui-media-box__info__meta"></li>
                                <li class="weui-media-box__info__meta">备注:{{item.remark}}</li>
                                <!-- 
                                <li class="weui-media-box__info__meta weui-media-box__info__meta_extra">其它信息</li> -->
                            </ul> 
                        </div>
                    </template>
                </div>
                    <div v-if="atmlog.page>0" class="weui-panel__ft">
                        <a @click="getAtmLog" href="javascript:void(0);" class="weui-cell weui-cell_access weui-cell_link" v-if="showmore">
                            <div class="weui-cell__bd" >查看更多</div>
                            <span class="weui-cell__ft"></span>
                        </a>    
                    </div>
                </div>
            </div>

        </div>
        
    </div>
</script>
<script>
    var myAtm = Vue.component('my-atm', {
        template: '#my-atm',
        data: function (){
            return {
                atm: {
                    money:'',
                    type:1,
                    idnum:'',
                    name:''
                },
                tabname: 'atm',
                atmlog:{
                    page:1,
                    list:[]
                },
                max:10,
                offset:0,
                showmore:false,
                myCash:personCash,
            }
        },
        created: function () {
            this.getAtmLog();
        },
        mounted:function() {
            var self = this;
            $(window).scroll(function(){
            　　var scrollTop = $(this).scrollTop();
            　　var scrollHeight = $(document).height();
            　　var windowHeight = $(this).height();
            　　if(scrollTop + windowHeight == scrollHeight){
                    if(self.showmore) {
                        if(self.$route.path=='/atm') {
                            self.getAtmLog();
                        }
                    }
            　　}
            });
        },
        methods:{
            //提现
            tixian:function () {
                var self = this;
                if(!this.atm.money || this.atm.money<=0) {
                    weui.alert('请正确填写提现金额');
                    return false;
                }
                var money = this.atm.money*100
                var cfm = weui.confirm('确定提现吗?',function(){
                    http({
                        url: config + '/api/security/take/'+openid+'/'+money,
                    }).then(function(res){
                        
                        if(res.status==200){
                            cfm.hide(function(){
                                weui.alert(res.data.msg,function(){
                                    self.$router.push('/my');
                                });
                            });
                        }else{
                            cfm.hide(function(){
                                weui.alert(res.message);
                            }); 
                        }
                    });
                    return false;
                })
            },
            getAtmLog: function () {
                var self = this;
                http({
                    url: config + '/api/person/cash/'+openid+'/'+self.max+'/'+self.offset,
                }).then(function(res){
                    if(res.status==200) {
                        for(var i=0;i<res.data.cashs.length;i++) {
                            self.atmlog.list.push(res.data.cashs[i]);
                        }
                        self.offset = self.offset + 10 ;
                        self.showmore = res.data.cashs.length!=0 ? true : false
                        // debugger
                    }else{
                        self.offset = 0;
                    }
                })
            }
        }
    })
</script>
<style>
    .myrefer .weui-navbar+.weui-tab__panel {
        padding-top: 0;
        padding-bottom: 0;
    }
</style>
<script type="text/x-template" id='my-refer'>
    <div class="myrefer">
        <div  class="weui-tab">
            <div style="display:none;" class="weui-navbar">
                <div @click="tabname='haibao'" :class="tabname=='haibao'?'weui-bar__item_on':''" class="weui-navbar__item ">
                    专属海报
                </div>
                <!-- <div @click="tabname='log'" :class="tabname=='log'?'weui-bar__item_on':''" class="weui-navbar__item">
                    奖励记录
                </div> -->
            </div>
            <div v-if="tabname=='haibao'" class="weui-tab__panel">
                <img :src="haibao" width="100%">
                                <center>过期时间:2018-05-25 21:42:28<center>
                            </div>

            <div v-if="tabname=='log'" class="weui-tab__panel">
                <div  class="weui-panel">
                    <!--   <div class="weui-panel__hd">文字列表附来源</div> -->
                    <template v-for="item in log.list">
                        <div class="weui-panel__bd">
                            <div class="weui-media-box weui-media-box_text">
                                <h4 class="weui-media-box__title">金额:{{item.num}}</h4>
                                <p class="weui-media-box__desc">
                                    来源:{{item.remark}}
                                </p>
                                <ul class="weui-media-box__info">
                                </ul> 
                            </div>
                        </div>
                    </template>
                    <div v-if="log.page>0" class="weui-panel__ft">
                        <a @click="getLog" href="javascript:void(0);" class="weui-cell weui-cell_access weui-cell_link">
                            <div class="weui-cell__bd">查看更多</div>
                            <span class="weui-cell__ft"></span>
                        </a>    
                    </div>
                </div>
            </div>

        </div>
    </div>
</script>
<script>
    var myRefer = Vue.component('my-refer', {
        template: '#my-refer',
        data: function (){
            return {
                tabname: 'haibao',
                log:{
                    page:1,
                    list:[]
                },
                haibao:''
            }
        },
        created: function () {
            this.getHaiBao();
            this.getLog();
        },
        methods:{
            getLog: function () {
                var self = this;
                http({
                    url: newBaseUrl + 'getreferlog&page='+self.log.page
                }).then(function(res){
                    res = res.data;
                    if(res.ret==0) {
                        for(var i=0;i<res.data.length;i++) {
                            self.log.list.push(res.data[i]);
                        }
                        self.log.page++;
                    }else{
                        self.log.page = 0;
                    }
                })
            },
            getHaiBao: function () {
                var self = this;
                http({
                    url: baseUrl + 'gethaibao',
                }).then(function(res){
                    res = res.data;
                    self.haibao = res.data;
                })
            }
        }
    })
</script>
<script type="text/x-template" id='my-paylog'>
    <div>
        <div class="weui-tab__panel">
            <div class="weui-panel">
                <div class="weui-panel__bd">
                    <template v-for="item in log.list">
                        <div class="weui-media-box weui-media-box_text weui-flex" >
                            <div class="myLeft weui-flex__item">
                                <h4 class="weui-media-box__title">金额:{{item.cash/100}}元</h4>
                                <p class="weui-media-box__desc" >
                                    时间:{{item.dateCreated}}  </p>
                                <ul class="weui-media-box__info">
                                    备注:{{item.remark}}
                                </ul> 
                            </div>
                            <div  class="myRight" >
                                <span class="myBtn myBtn1" v-if="item.refund == -1" @click="tuikuan(item.orderID)">申请退款</span>
                                <span class="myBtn myBtn2" v-if="item.refund == 1">退款中</span>
                                <span class="myBtn myBtn3" v-if="item.refund == 0">退款完成</span>
                            </div>    
                        </div>
                        
                    </template>
                </div>
                <!--<div v-if="log.page>0" class="weui-panel__ft">
                    <a @click="getLog" href="javascript:void(0);" class="weui-cell weui-cell_access weui-cell_link">
                        <div class="weui-cell__bd">查看更多</div>
                        <span class="weui-cell__ft"></span>
                    </a>  --> 
                </div>
            </div>
        </div>
    </div>
</script>
<script>
    var myPaylog = Vue.component('my-paylog', {
        template: '#my-paylog',
        data: function (){
            return {
                tabname: 'haibao',
                log:{
                    page:1,
                    list:[]
                },
            }
        },
        created: function () {
            this.getLog();
        },
        methods:{
            getLog: function () {
                var self = this;
                http({
                    url: config + '/api/security/payList/'+openid
                }).then(function(res){
                    data = res.data;
                    
                    if(res.status==200) {
                        for(var i=0;i<data.length;i++) {
                            self.log.list.push(data[i]);
                        }
                    }
                })
            },
            tuikuan: function(orderID) {
                var self = this;
                var cfm = weui.confirm('21天之后才能退款，确认申请退款吗?',function(){
                    http({
                        url: config + '/api/security/refund/'+openid+'/'+orderID
                    }).then(function(res){
                        var data = res.data
                        
                        if(res.status){
                            cfm.hide(function(){
                                weui.alert(data.msg,function(){
                                    self.getLog()
                                })
                            })
                        }
                    })
                    return false;
                })
            },
        }
    })
</script>
<style>
    .weui-media-box__title{
        overflow: visible;
        font-size: 14px;
    }
    .weui-navbar__item.weui-bar__item_on{
        color:#1cc721;
    }
    
    .myLeft{
        width:80%;
        float: left
    }
    .myRight{
        width: 20%;
        float:right;
        display: flex;
        justify-content:center;
        align-items:center;
    }
    .myBtn{
        width:60px;
        height: 25px;
        line-height: 25px;
        text-align: center;
        border-radius: 4px;
        cursor: pointer;
        font-size: 12px;
        background:#1aad19;
        color:#fff;
    }
    .myBtn1{
        background:#e64340;
    }
    .myBtn2{
        background:orange;
        opacity: 0.5;
    }
    .myBtn3{
        background:#1aad19;
        opacity: 0.5;
    }
</style>
<script type="text/x-template" id='paihang'>
    <div>
        <div class="weui-navbar">
            <div 
                @click="tab=1"
                :class="tab==1?'weui-bar__item_on':''" class="weui-navbar__item">
                连续打卡
            </div>
            <div 
                @click="tab=2"
                :class="tab==2?'weui-bar__item_on':''" class="weui-navbar__item ">
                累计奖励
            </div>
        </div>
        <div v-if="tab==1" class="weui-tab__panel">
            <template v-for="item in lianxu.list">
                <a  class="weui-media-box weui-media-box_appmsg">
                    <div class="weui-media-box__hd">
                        <img style="border-radius:100%" class="weui-media-box__thumb" :src="item.fans.headimgurl" alt="">
                    </div>
                    <div class="weui-media-box__bd">
                        <h4 class="weui-media-box__title">{{item.fans.nickname}}</h4>
                        <p class="weui-media-box__desc">连续打卡<span class='color'>{{item.lianxu}}</span>天</p>
                    </div>
                </a>
            </template>
            <div v-if="lianxu.page>0" class="weui-panel__ft">
                <a @click="getLianxuList"  class="weui-cell weui-cell_access weui-cell_link">
                    <div class="weui-cell__bd">查看更多</div>
                    <span class="weui-cell__ft"></span>
                </a>    
            </div>
        </div>
        <div v-if="tab==2" class="weui-tab__panel">
            <template v-for="item in jiangli.list">
                <a  class="weui-media-box weui-media-box_appmsg">
                    <div class="weui-media-box__hd">
                        <img style="border-radius:100%" class="weui-media-box__thumb" :src="item.fans.headimgurl" alt="">
                    </div>
                    <div class="weui-media-box__bd">
                        <h4 class="weui-media-box__title">{{item.fans.nickname}}</h4>
                        <p class="weui-media-box__desc">累计奖励<span class='color'>{{item['sum(money)']}}</span>元</p>
                    </div>
                </a>
            </template>
            <div v-if="jiangli.page>0" class="weui-panel__ft">
                <a @click="getJiangliList" class="weui-cell weui-cell_access weui-cell_link">
                    <div class="weui-cell__bd">查看更多</div>
                    <span class="weui-cell__ft"></span>
                </a>    
            </div>
        </div>
    </div>
</script>
<script>
    var paihang = Vue.component('paihang', {
        template: '#paihang',
        data: function () {
            return {
                tab:1,
                lianxu: {
                    page:1,
                    list:[]
                },
                jiangli: {
                    page:1,
                    list:[]
                }
            }
        },
        created: function () {
            this.getLianxuList();
            this.getJiangliList();
        },
        methods: {
            getLianxuList: function () {
                var self = this;
                http({
                    url: baseUrl + 'lianxulist&page='+self.lianxu.page
                }).then(function(res){
                    res=res.data;
                    if(res.ret==0) {
                        for(var i=0;i<res.data.length;i++) {
                            self.lianxu.list.push(res.data[i]);
                        }
                        self.lianxu.page ++;
                    }else{
                        self.lianxu.page = 0;
                    }
                })
            },
            getJiangliList: function () {
                var self = this;
                http({
                    url: baseUrl + 'jianglilist&page='+self.jiangli.page
                }).then(function(res){
                    res=res.data;
                    if(res.ret==0) {
                        for(var i=0;i<res.data.length;i++) {
                            self.jiangli.list.push(res.data[i]);
                        }
                        self.jiangli.page ++;
                    }else{
                        self.jiangli.page = 0;
                    }
                })
            }
        }
    });
</script> 
<style>
    input[type=color],
    input[type=date],
    input[type=datetime-local],
    input[type=datetime],
    input[type=email],
    input[type=month],
    input[type=number],
    input[type=password],
    input[type=search],
    input[type=tel],
    input[type=text],
    input[type=time],
    input[type=url],
    input[type=week],
    select,
    textarea {
        width: 100%;
        height: 1.47058824em;
        line-height: 1.47058824;
        -webkit-appearance: none;
        padding: 0;
        margin-bottom: 0;
        background-color: transparent;
        border: none;
        border-radius: 0;
        outline: none;
        font-size: inherit;
        color: inherit;
        -webkit-user-select: text;
    }
</style>
<script type="text/x-template" id='warn'>
    <div>
        <div style="margin-top:0;" class="weui-cells weui-cells_form">
            <div class="weui-cells__title">设置提醒</div>
            <div class="weui-cell weui-cell_switch">
                <div class="weui-cell__bd">提醒开关</div>
                <div class="weui-cell__ft">
                    <input v-model="warn.iswarn" class="weui-switch" type="checkbox">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">提醒时间</label></div>
                <div class="weui-cell__bd">
                    <input @click="showTime()" v-model="warn.warntime" readonly class="weui-input" type="text" placeholder="请选择时间">
                </div>
            </div>
        </div>
        <div class="weui-btn-area">
            <a class="weui-btn weui-btn_primary" @click="setWarn()" id="showTooltips">确定</a>
        </div>
    </div>
</script>
<script>
    var warn = Vue.component('warn', {
        template: '#warn',
        data: function () {
            return {
                warn: {
                    iswarn: false,
                    warntime: ''
                },
                userinfo:{}
            }
        },
        created: function () {
            window.v = this;
            this.getUserinfo();
        },
        methods: {
            getUserinfo: function () {
                var self = this;
                http({
                    url: baseUrl + 'getuserinfo',
                }).then(function (res) {
                    res = res.data;
                    self.userinfo = res.data;
                    self.warn.iswarn = res.data.iswarn==1?true:false;
                    self.warn.warntime = res.data.warntime;
                })
            },
            showTime: function () {
                var self = this;
                var hour = [];
                for (var i = 5; i <= 7; i++) {
                    hour.push({
                        label: i + '时',
                        value: i
                    });
                }
                var minutes = [];
                for (var i = 0; i <= 59; i++) {
                    minutes.push({
                        label: i + '分',
                        value: i
                    });
                }
                weui.picker(hour, minutes, {
                    defaultValue: [7, 0],
                    onChange: function (result) {
                        console.log(result);
                    },
                    onConfirm: function (result) {
                        self.warn.warntime = result[0].value + ':' + result[1].value;
                    },
                });
            },
            setWarn: function () {
                var self = this;
                http({
                    url: baseUrl + 'setwarn',
                    method: 'post',
                    data: self.warn
                }).then(function (res) {
                    res = res.data;
                    weui.alert(res.message,function(){
                        self.$router.go(-1);
                    });
                })
            }
        }
    });
</script> 
<style>
    </style>
    <script type="text/x-template" id='kefu-index'>
        <div id="kefu">
            <div  class="detail"><p style="margin-top: 15px; margin-bottom: 15px; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px; text-align: center;"><span style="color: rgb(255, 0, 0);"><strong>强烈建议您提前添加客服微信</strong></span><br/></p><p style="margin-top: 15px; margin-bottom: 15px; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px; text-align: center;">如有任何疑问</p><p style="margin-top: 15px; margin-bottom: 15px; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px; text-align: center;">请联系客服</p><p style="margin-top: 15px; margin-bottom: 15px; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px; text-align: center;"><img src="http://cdn.falvboke.com/images/1/2018/03/zQMIM3qZ893qLPUlcA09U380yPy9mL.jpg" width="367" alt="你能早起吗客服二维码.jpg" height="342" style="width: 367px; height: 342px;"/></p><p style="margin-top: 15px; margin-bottom: 15px; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px; text-align: center;">长按识别添加客服微信<br/></p><p style="margin-top: 15px; margin-bottom: 15px; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px; text-align: center;"><br/></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><span style="color: rgb(192, 0, 0);"><strong>常见问题（建议仔细阅读）</strong></span></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><strong>1.打卡时间是多久？打卡入口在哪里？</strong></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">平台打卡时间为每天早6:30至7:00。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">6:30之前初次支付挑战金的当天须参与打卡，6:30之后初次支付挑战金的次日开始打卡。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">您可以长按识别下方二维码关注公众号，通过公众号菜单栏的[参与挑战]入口进入打卡页面。</p><p style="margin-top: 15px; margin-bottom: 15px; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px; text-align: center;"><br/></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><strong>2.如遇极端情况无法打卡如何处理？</strong></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">对于无法打卡的情况挑战规则给予了充分考虑。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">若您遭遇极端情况，您可以在<span style="color: rgb(255, 0, 0);"><strong>打卡时间内</strong></span>联系客服，客服会为您登记并提交工单给技术部门直接进行处理。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><span style="color: rgb(255, 0, 0);"><strong>特别提醒：</strong></span>一定要在打卡时间内联系客服，非打卡时间内联系客服的无法做出任何处理，若未打卡则挑战金将被当日打卡挑战者瓜分。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><strong>3.如何完成打卡验证？</strong></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">为了确保早起挑战活动的公平性，防止自动打卡脚本，平台在打卡期间启用了人机验证，有几率出现验证信息。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">如出现验证信息，挑战者在点击[立即打卡]按钮之后，会跳出验证图片，挑战者仅需要按照图片提示的路径及方向滑动即可完成验证，若对图片验证有疑问，请联系客服。</p><p style="margin-top: 15px; margin-bottom: 15px; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px; text-align: center;"><img src="http://cdn.falvboke.com/images/1/2018/02/RbXPCe6kHcNMK1S426ck4Se6vmyhv4.jpg" width="305" alt="001.jpg" height="170"/></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><strong>4.如何确保已经打卡成功？</strong></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">点击[立即打卡]按钮之后，完成人机验证，系统会提示您打卡成功。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">同时您会收到公众号给您一条提示打卡成功的提示信息，该信息作为您打卡成功的最终凭证，<span style="color: rgb(255, 0, 0); text-decoration-line: underline;"><strong>若打卡成功以但未收到该提示信息，须要在打卡时间内联系客服报备</strong></span>。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><strong>5.奖励的具体瓜分规则是什么？</strong></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">当日打卡挑战者按份额瓜分未打卡挑战者的挑战金。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">举个栗子：ABC三人分别支付20元、50元、140元挑战金，若当日AB准时打卡，C未打卡，则由AB瓜分C的挑战金140元，其中AB共有70份额，A占20份额，B占50份额，因此A瓜分到的奖励为40元，B瓜分到的奖励为100元。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><strong>6.5000元挑战金可以瓜分多少奖励？</strong></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">无法确定。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">因为按照挑战规则，瓜分奖励是由挑战金份额和未打卡金额共同决定的，在至确定挑战金份额为5000元，而未打卡金额未确定的情况下，是无法确定5000元挑战金瓜分的奖励多寡的呢。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">从历史数据来看，5000元挑战金，最低瓜分10元，最高瓜分410元。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><strong>7.若忘记打卡，挑战金可以退回吗？</strong><br/></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">不能退回。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">若当日未打卡，未打卡挑战者的挑战金将被当日打卡挑战者瓜分，无法退款。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><strong>8.瓜分的奖励什么时间到账？</strong></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">系统一般在早11点开始计算并分发早起奖励到余额。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">系统会根据服务器资源消耗情况，适当提前及延后奖励瓜分的计算与分发，属于正常现象。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><strong>9.平台余额怎么提现？</strong></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">您可以进入[个人中心]页面点击[我的余额]即可进入提现页面操作提现。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">在提现页面，微信自动登录挑战者可以选择微信或支付宝提现；因注册用户无法获取到微信支付账户信息，因此仅支持支付宝提现。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><strong>10.平台余额提现有什么限制条件吗？</strong></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">奖励金提现除微信红包支付系统要求提现金额需大于1元以外，无其他任何限制。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">出于安全考虑，提现限制每分钟操作一次（操作失败也计算一次提现操作，需要间隔1分钟再次操作），若提示您操作频繁，建议您稍后再试。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><strong>11.如何退回挑战金？</strong></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">您可以在连续打卡满21天周期之时，进入[个人中心]页面，点击[我的投入]，进入当前挑战金的支付记录页面，选择您需要退款的支付记录进行退款。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">当然，您也可以选择不退款，自动进入下一个挑战周期，当挑战连续打卡满21天之时，可以再次操作退款。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><strong>12.挑战金退回的到账时间是多久？</strong></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">挑战金申请退回发起后平台会在24小时内（正常每天20:00集中统一处理）向支付机构（微信/支付宝）进行退款。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">支付机构在收到退款以后，会按照支付路径进行退回，这部分的退款时间辛苦您关注支付机构给您的提示信息，平台方面无法控制。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><strong>13.追加挑战金什么时候可以退回？</strong></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">追加挑战金无单独退款时间，与追加前挑战金可退款时间一致。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">关于是否能够退款，系统在判断的时候仅判断您的连续打卡天数是否满足21天周期，若满足连续打卡满21天的周期就可以退款，因此支付时间对于是否能够退款没有影响。</p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;"><strong>14.平台怎么赢利？</strong></p><p style="margin-top: 15px; margin-bottom: 15px; text-align: justify; white-space: normal; font-size: 14px; line-height: 2; padding-right: 10px; padding-left: 10px;">二十一世纪是粉丝经济时代，有足够粉丝沉淀就一定能变现。当前已上线广告系统，并有广告主投放广告；同时我们即将上线淘客系统，通过购物返利方式赢利；在其他收益不足以维持平台运营时，平台会酌情扣取适量奖励金份额，以维持平台持续向前发展。</p><p><br/></p></div>
        </div>
    </script>
    <script>
        var kefuIndex = Vue.component('kefu-index', {
            template: '#kefu-index',
            data: function () {
                return {
                    id: '',
                    kefu: {},
                }
            },
            created: function () {
               
            },
            mounted: function () {
            },
            methods: {
                
            }
        });
    </script> 
<style>
</style>
<script type="text/x-template" id='jiameng-index'>
    <div id="jiameng">
        <div  class="detail"></div>
    </div>
</script>
<script>
    var jiamengIndex = Vue.component('jiameng-index', {
        template: '#jiameng-index',
        data: function () {
            return {
                id: '',
                jiameng: {},
            }
        },
        created: function () {
           
        },
        mounted: function () {
        },
        methods: {
            
        }
    });
</script> 
<script type="text/x-template" id='my-xiaji'>
    <div>
        <div class="weui-tab__panel">
            <div class="weui-panel">
                <div class="weui-panel__bd">
                    <template v-for="item in log.list">
                        <a @click="goToXiaji(item)" class="weui-media-box weui-media-box_appmsg ">
                            <div class="weui-media-box__hd">
                                <img style="border-radius:100%;" class="weui-media-box__thumb" :src="item.fans.headimgurl" alt="">
                            </div>
                            <div class="weui-media-box__bd">
                                <h4 class="weui-media-box__title">{{item.fans.nickname}}</h4>
                                <p class="weui-media-box__desc">
                                    参与金额:{{item.order?item.order.pay_money:'未参与'}}<br>
                                </p>
                            </div>
                            <span v-if="item.has==1" class="iconfont icon-right" style="position:absolute;right:5px;"></span>
                        </a>
                    </template>
                </div>
                <div v-if="log.page>0" class="weui-panel__ft">
                    <a @click="getLog" href="javascript:void(0);" class="weui-cell weui-cell_access weui-cell_link">
                        <div class="weui-cell__bd">查看更多</div>
                        <span class="weui-cell__ft"></span>
                    </a>    
                </div>
            </div>
        </div>
    </div>
</script>
<script>
    var myXiaji = Vue.component('my-xiaji', {
        template: '#my-xiaji',

        data: function (){
            return {
                tabname: 'haibao',
                log:{
                    page:1,
                    list:[]
                },
            }
        },
        created: function () {
            this.getLog();
        },
        watch: {
            '$route': 'reload'
        },
        methods:{
            reload:function () {
                this.log = {
                    page:1,
                    list:[]
                };
                this.getLog();
            },
            getLog: function () {
                var uid = this.$route.params.id;
                var self = this;
                http({
                    url: newBaseUrl + 'getxiaji&page='+self.log.page+'&uid='+uid
                }).then(function(res){
                    res = res.data;
                    if(res.ret==0) {
                        for(var i=0;i<res.data.length;i++) {
                            self.log.list.push(res.data[i]);
                        }
                        self.log.page++;
                        if(res.data.length<20) {
                            self.log.page = 0;
                        }
                    }else{
                        self.log.page = 0;
                    }
                })
            },
            goToXiaji:function (item) {
                if(item.has) {
                    this.$router.push('/xiaji/'+item.uid);
                }
                return;
            }
        }
    })
</script>
 
<script>
    var routes = [
        { path: '/','name':'index', component: indexBottom,meta: {keepAlive: false}},
        { path: '/lianxu', component: lianxuIndex,meta: {keepAlive: false}},
        { path: '/rule', component: lianxurule,meta: {keepAlive: false}},
        { path: '/kefu', component: kefuIndex,meta: {keepAlive: false}},
        { path: '/jiameng', component: jiamengIndex,meta: {keepAlive: false}},
        { path: '/my', component: myIndex,meta: {keepAlive: false}},
        { path: '/list', component: userList,meta: {keepAlive: false}},
        { path: '/xiaji/:id', component: myXiaji, props: true,meta: {keepAlive: false}},
        { path: '/atm', component: myAtm,meta: {keepAlive: false}},
        { path: '/refer', component: myRefer,meta: {keepAlive: false}},
        { path: '/paylog', component: myPaylog,meta: {keepAlive: false}},
        { path: '/paihang', component: paihang,meta: {keepAlive: false}},
        { path: '/warn', component: warn,meta: {keepAlive: false}},
        { path: '*','name':'index', component: indexBottom,meta: {keepAlive: true}},
    ];
    var router = new VueRouter({
        routes:routes
    });
    var app = new Vue({
        el: '#app',
        router:router ,
        data:{
            imgList:['img/p1-1.png','img/p2.png','img/p3.png'],
            colorList:['myColor','myColor2','myColor2']
        },
        methods: {
            selectedA(type) {
                if(type == 1){
                    if(this.imgList[0] == 'img/p1.png'){
                        this.imgList = ['img/p1-1.png','img/p2.png','img/p3.png']
                        this.colorList = ['myColor','myColor2','myColor2']
                    }
                }
                if(type == 2){
                    if(this.imgList[1] == 'img/p2.png'){
                        this.imgList = ['img/p1.png','img/p2-1.png','img/p3.png']
                        this.colorList = ['myColor2','myColor','myColor2']
                    }
                }
                if(type == 3){
                    if(this.imgList[2] == 'img/p3.png'){
                        this.imgList = ['img/p1.png','img/p2.png','img/p3-1.png']
                        this.colorList = ['myColor2','myColor2','myColor']
                    }
                }
            }
        }

    });
</script>